#GroupDocs.Viewer for Java
##Dropwizard Sample 2.9.1
![Alt text](https://media.licdn.com/media/p/7/005/059/258/39b2da3.png "GroupDocs")


###Description

A powerful document viewer API that allows you to display over 50 document formats in your Java applications. The viewer can work two ways: by rasterizing documents or by converting them to a combination of SVG, HTML and CSS. Both methods deliver high-fidelity rendering.

Supported file formats include: Microsoft Office, Visio, Project and Outlook documents, PDFs, AutoCAD, image files (TIFF, JPG, BMP, GIF, TIFF, etc.) and more.


###How-to install/run

1. Download GroupDocs.Viewer for Java library http://groupdocs.com/java/document-viewer-library
2. Install GroupDocs.Viewer for Java library into local maven repository http://groupdocs.com/docs/display/viewerjava/GroupDocs.Viewer+for+Java+-+Installation
3. Download sample sources to any directory.
4. Open file `configuration.yml` and update configuration (eg: update assets to set the path to the storage folder). More information on parameters is available in the documentation (http://groupdocs.com/docs/display/viewerjava/GroupDocs.Viewer+for+Java+-+Parameters).
5. Execute the run file to start sample application:
  * **Widnows** - `run.bat`
  * **Linux** - `run.sh`
  * **MacOS** - `run.command`
6. Open URL `http://127.0.0.1:8080/` in your browser, make sure that port 8080 is free (otherwise change port number in _configuration.yml_).


###How to view/open file documents

The sample can open documents from:
* a local filesystem (storage path configured in the _configuration.yml_)
* a remote location (through the URL)
* a user's computer (through the upload file form)

Files from the filesystem are accesable through the "Open File" dialog or the GET parameter `file`.

#####Usage of the GET parameter `file`:
1. Go to http://127.0.0.1:8080/view?file=file_id
2. Go to http://127.0.0.1:8080/view?file=full_file_path
3. Go to http://127.0.0.1:8080/view?file=url_to_file
4. Go to http://127.0.0.1:8080/view?tokenId=token_id

Where values of the parameter `file` can have next meanings:

* `file_id` is the name of the file in the filepath specified in the _configuration.yml_ (`filesPath`)
* `full_file_path` is the complete path of the file in the application local filesystem, starting from the root (disk or folder, depending on the OS)
* `url_to_file` - URL address of the file in the network
* `token_id` - ID assigned to the file after it was uploaded through the upload form, uploaded files are accessible through such IDs

